package top.zackyoung.springboot.config

import com.alibaba.fastjson.serializer.ValueFilter
import java.math.BigDecimal

class KotlinBigDecimalValueFilter :ValueFilter{
    override fun process(o: Any?, name: String?, value: Any?): Any? {
        return if (value != null && value is BigDecimal) {
            (value as BigDecimal).stripTrailingZeros().toPlainString()
        } else value
    }
}